        <!-- 只有管理员和超级管理员可以看到排班按钮 -->
        <template v-if="isAdmin">
          <el-button type="success" @click="handleScheduleAction(formatDate(new Date()), 'add')">添加排班</el-button>
          <el-button type="warning" @click="handleBatchSchedule">一键排班</el-button>
        </template>
                  v-if="!isPastDate(data.day) && isAdmin" 
                v-else-if="!isPastDate(data.day) && isAdmin" 
                {{ isPastDate(data.day) ? '已过期' : '未排班' }}
            :disabled-date="disablePastDates"
import { ref, onMounted, watch, nextTick, computed } from 'vue'
import { useStore } from 'vuex'
  date: [{ required: true, message: '请选择日期', trigger: 'change' }]

const store = useStore()

// 判断是否为管理员或超级管理员
const isAdmin = computed(() => {
  const role = store.state.user.role
  return ['admin', 'superadmin'].includes(role)
})

// 在 script 部分添加 disablePastDates 函数
const disablePastDates = (date: Date) => {
  const today = new Date()
  today.setHours(0, 0, 0, 0)
  return date.getTime() < today.getTime()
}